home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 11727 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: news1.cris.com!crawford
  2. From: crawford@kloognome.cris.com (Robert A. Crawford)
  3. Newsgroups: comp.lang.c,comp.lang.c++
  4. Subject: Re: Calling System Command in SUN C
  5. Date: 15 Mar 1996 22:25:11 GMT
  6. Organization: Concentric Internet Services
  7. Message-ID: <slrn4kjt4j.1h4.crawford@kloognome.cris.com>
  8. References: <4i1hlu$asm@ni1.ni.net> <4i41j0$8nu@dawn.mmm.com> <4i8uht$1po@abacus.abasoft.co.uk>
  9. NNTP-Posting-Host: cnc802136.concentric.net
  10. X-Newsreader: slrn (0.8.6.1)
  11.  
  12. In article <4i8uht$1po@abacus.abasoft.co.uk>, David Byrne wrote:
  13. >In article <4i41j0$8nu@dawn.mmm.com>, Kevin J Hopps <kjhopps@mmm.com> wrote:
  14. >>The system(3S) function does what you want.  You pass it a string
  15. >>which is the command to execute.  It returns the exit status of
  16. >>the command.
  17. >Close - the exit status you want is in the 8 high-order bits of the return
  18. >value. On the Sun, you need to do something like
  19.  
  20. [code snipped]
  21.  
  22.     Aren't the macros from sys/wait.h a more portable way to
  23. extract the exit status?
  24.  
  25. -- 
  26. Robert Crawford         crawford@iac.net     http://www.iac.net/~crawford
  27.  
  28. Heed the words of the dead, for they are the least likely to
  29. be trying to get something from you.
  30.  
  31.